﻿@model IEnumerable<EasyStep.Data.Entities.TestProject>

@{
    ViewBag.Title = "Available project";
}
<h2>Available Projects</h2>
<ul>
    <li class="buttons-li">
        @Html.ActionLink("Register New", "Create", "TestProject", new { @class="ui-button ui-corner-all"})
    </li>
     
     
@foreach (var item in Model)
{
    <li class="project-li">
        <a href="@Url.Action("Details", "Project", new { id = item.Id })">
            @Html.DisplayFor(modelItem => item.Name)
       </a>
       <ul class="project-consts">
        @if (item.ConstantLists.Count() == 0) 
       { 
            <li class="item const-li empty">
                no one constant list exists in this project
            </li>
       }
       @foreach (var citem in item.ConstantLists)
       { 
           
           <li class="item const-li">
                <a href="@Url.Action("Details", "TestConstList", new { id = citem.Id, Project=item.Id })">
                    @Html.DisplayFor(modelItem => citem.Name)
                </a>
           </li>
       }
       </ul>
       <ul class="project-tests">
        @if (item.Tests.Count() == 0) 
       { 
            <li class="item const-li empty">
                no one test exists in this project
            </li>
       }
       @foreach (var titem in item.Tests)
       { 
           
           <li class="item const-li">
                <a href="@Url.Action("Details", "Test", new { id = titem.Id, Project=item.Id })">
                    @Html.DisplayFor(modelItem => titem.Name)
                </a>
           </li>
       }
       </ul>
    </li>
}    
</ul>